/*---------------------------------------------------------------------------
    MSN Proxy
    A SOCKS4 Proxy for MSN Messenger allowing you to change your initial status
    on sign-in and to intercept/change/send messages using plugins. 

    Copyright (C) 2001-2004 Dirk Groot aka MrHuge

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    You can contact me on the following email address:
    mrhuge@users.sourceforge.net
---------------------------------------------------------------------------*/
#ifndef __MSNProxy_Plugin_H__
#define __MSNProxy_Plugin_H__

// Some useful defines
#define MAX_HOSTNAME_LENGTH     256
#define MAX_SINGINNAME_LENGTH   256
#define MAX_SESSIONID_LENGTH    256
#define MAX_FRIENDLYNAME_LENGTH 130
#define MAX_PLUGINNAME_LENGTH   256
#define MAX_AUTHOR_LENGTH       256

/*---------------------------------------------------------------------------
 * Description:
 *   Result enumeration of functions which can be called from the plugin.
 *---------------------------------------------------------------------------*/
typedef enum
{
  crOk,           // Everything went fine
  crNoSuchSession // The Session ID does not exist
} TCallbackResult;

/*---------------------------------------------------------------------------
 * Description:
 *   Function typedef of the FSendMessage callback function (see THostInfo).
 *   With this function you can send an instant message from your plugin to
 *   the remote user.
 * Parameters:
 *   pcSessionID  : Session ID of the session to send this message to
 *   bHidden      : If true, the message will ben encapsulated within a
 *                  'user typing' message, and won't be visible for the remote
 *                  user. When true, pcFontString will be ignored.
 *   pcFontString : String describing the font which must be used for this message.
 *                  If you leave this empty, the message will be sent in
 *                  Microsoft Sans Serif, 12pt.
 *                  (see http://www.hypothetic.org/docs/msn/messaging.php for more info).
 *   pcMessage    : The message-content to send
 * Return value:
 *   TCallbackResult enum (see above).
 *---------------------------------------------------------------------------*/
typedef TCallbackResult (*TSendMessageFunction)(char *pcSessionID, bool bHidden, char *pcFontString, char *pcMessage);

/*---------------------------------------------------------------------------
 * Description:
 *   Function typedef of the FSendLocalMessage callback function (see THostInfo).
 *   With this function you can send an instant message from your plugin to the
 *   local user (so you will see it in your own conversation window).
 * Parameters:
 *   pcSessionID      : Session ID of the session to send this message to
 *   bHidden          : If true, the message will ben encapsulated within a
 *                      'user typing' message, and won't be visible for the remote
 *                      user. When true, pcFontString will be ignored.
 *   pcSenderSignIn   : SignIn name of the sender of the local message
 *   pcSenderFriendly : Friendly name of the sender of the local message
 *   pcFontString     : String describing the font which must be used for this message.
 *                      If you leave this empty, the message will be sent in
 *                      Microsoft Sans Serif, 12pt.
 *                      (see http://www.hypothetic.org/docs/msn/messaging.php for more info).
 *   pcMessage        : The message-content to send
 * Return value:
 *   TCallbackResult enum (see above).
 *---------------------------------------------------------------------------*/
typedef TCallbackResult (*TSendLocalMessageFunction)(char *pcSessionID, bool bHidden, char *pcSenderSignIn, char *pcSenderFriendly, char *pcFontString, char *pcMessage);

/*---------------------------------------------------------------------------
 * Description:
 *   Information about a conversation session.
 *---------------------------------------------------------------------------*/
typedef struct
{
    char acSBHost[MAX_HOSTNAME_LENGTH],     // Address of the switchboard server
         acSessionID[MAX_SESSIONID_LENGTH]; // Unique ID
    int  iSBPort;                           // Network port used to connect to the switchboard server
} TSessionInfo;

/*---------------------------------------------------------------------------
 * Description:
 *   Structure with information about this plugin. This information will be
 *   displayed in the plugin list of MSN Proxy.
 *---------------------------------------------------------------------------*/
typedef struct
{
    char acName[MAX_PLUGINNAME_LENGTH]; // Name of the plugin
    char acAuthor[MAX_AUTHOR_LENGTH];   // Author of the plugin
} TPluginInfo;

/*---------------------------------------------------------------------------
 * Description:
 *   Structure with information about the host application (MSN Proxy).
 *---------------------------------------------------------------------------*/
typedef struct
{
    HWND                      hMainWindow;       // Handle of the main window (which is the setup window for now)
    TSendMessageFunction      FSendMessage;      // Address of the 'SendMessage' function
    TSendLocalMessageFunction FSendLocalMessage; // Address of the 'SendLocalMessage' function
} THostInfo;

#endif 
